<style type="text/css">
.layui-form-item .layui-form-label{width:150px;}
.layui-form-item .layui-input-inline{max-width:70%;width:50%;}
.layui-form-mid{padding:0!important;}
.layui-form-mid code{color:#5FB878;}
</style>
<form class="layui-form layui-form-pane" action="{:url()}" method="post" id="editForm">
    
    <div class="layui-form-item">
        <label class="layui-form-label">团队名</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input field-name " name="name" lay-verify="required" autocomplete="off" placeholder="请输入用户名">
        </div>
    </div>
	
	<div class="layui-form-item">
		<label class="layui-form-label">图片</label>
		<div class="layui-input-inline upload">
		
			<button type="button" name="upload" class="layui-btn layui-btn-primary layui-upload" lay-type="image" lay-data="{ {if condition="exts:'{:str_replace(',', '|', config('upload.upload_image_ext'))}', accept:'image'}">请上传图片</button>
			
			<button type="button" name="clear" id="clear_url" class="layui-btn layui-btn-primary ">清空图片</button>
			
			<input type="hidden" class="upload-input" name="url" value="{$data_info['url']}">
			{if condition="$data_info['url']"}
				<img id="img_url" src="{$data_info['url']}" style="display:inline-block;border-radius:5px;border:1px solid #ccc" width="300" >
			{else /}
				</br></br><img id="img_url" src="" style="display:none;border-radius:5px;border:1px solid #ccc" width="300" >
			{/if}
		</div>
		 
	</div>
			
    
    <div class="layui-form-item">
        <label class="layui-form-label">是否官方</label>
        <div class="layui-input-inline">
            <input type="radio" class="field-isgf" name="isgf" value="1" title="是" checked>
            <input type="radio" class="field-isgf" name="isgf" value="0" title="否">
        </div>
    </div>
	<div class="layui-form-item">
        <label class="layui-form-label">排序</label>
        <div class="layui-input-inline">
             <input type="text" class="layui-input field-zdorder" name="zdorder"  autocomplete="off" placeholder="请输入数字">
        </div>
		 <div class="layui-form-mid layui-word-aux"><a href="javascript:void(0);" >越大越靠前</a></div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <input type="hidden" class="field-id" name="id">
            <button type="submit" class="layui-btn" lay-submit="" lay-filter="formSubmit">提交</button>
            <a href="{:url('index')}" class="layui-btn layui-btn-primary ml10"><i class="aicon ai-fanhui"></i>返回</a>
        </div>
    </div>
	 
</form>
<script>
var formData = {:json_encode($data_info)};

layui.use(['jquery', 'laydate', 'upload'], function() {
    var $ = layui.jquery, laydate = layui.laydate, layer = layui.layer, upload = layui.upload;
    upload.render({
        elem: '.layui-upload',
        url: '{:url("admin/annex/upload?thumb=no&water=no")}'
        ,method: 'post'
        ,before: function(input) {
            layer.msg('文件上传中...', {time:3000000});
        },done: function(res, index, upload) {
            var obj = this.item;
            if (res.code == 0) {
                layer.msg(res.msg);
                return false;
            }
            layer.closeAll();
            var input = $(obj).parents('.upload').find('.upload-input');
            if ($(obj).attr('lay-type') == 'image') {
                input.siblings('img').attr('src', res.data.file).show();
            }
            input.val(res.data.file);
        }
    });
    // 日期渲染
    laydate.render({elem: '.layui-date'});
	
	$("#clear_url").click(function(){
		$("input[name='url']").val("");
		$("#img_url").attr("src","");
	});
	
});



</script>
<script src="__ADMIN_JS__/footer.js"></script>